Skip to content

fix(app-tools): restore dev server runtime stability for server config#8500

Merged
caohuilin merged 2 commits intomainfrom
fix/bff-hono-dev-runtime
Apr 1, 2026
Merged

fix(app-tools): restore dev server runtime stability for server config#8500
caohuilin merged 2 commits intomainfrom
fix/bff-hono-dev-runtime

Conversation

@GiveMe-A-Name
Copy link
Copy Markdown
Member

Summary

  • prefer ts-node for dev server runtime loading when available
  • preserve the Node 22 loader path for the existing server-config scenario
  • fix bff-hono dev middleware and context behavior regression

Verification

  • cd tests && npm run test:framework --filter server-config
  • cd tests && npm run test:framework --filter bff-hono

Prefer ts-node for dev server runtime loading when available.

This keeps server middleware and context behavior stable under Node 22.

Co-Authored-By: Aiden
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

🦋 Changeset detected

Latest commit: 15c5457

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 115 packages
Name Type
@modern-js/app-tools Patch
@modern-js/adapter-rstest Patch
@modern-js/plugin-bff Patch
@modern-js/plugin-ssg Patch
@modern-js/plugin-styled-components Patch
@modern-js/plugin-i18n Patch
@modern-js/image Patch
@modern-js/runtime Patch
@modern-js/plugin-polyfill Patch
@integration-test/alias-set Patch
app-document Patch
async-entry-test Patch
tmp Patch
bff-api-app Patch
bff-client-app Patch
bff-indep-client-app Patch
bff-hono Patch
integration-clean-dist-path Patch
integration-compatibility Patch
integration-custom-dist-path Patch
custom-file-system-entry Patch
integration-custom-template Patch
deploy Patch
deploy-server Patch
dev-server Patch
integration-disable-html Patch
entries-app-builder Patch
app-custom-entries Patch
app-custom-routes-runtime Patch
app-custom Patch
app-entry Patch
app-route Patch
app-entry-server Patch
i18n-app-csr-html-lang Patch
i18n-app Patch
i18n-app-ssr-html-lang Patch
i18n-app-ssr Patch
i18n-custom-i18n-wrapper Patch
i18n-mf-app-provider Patch
i18n-mf-component-provider Patch
i18n-mf-consumer Patch
i18n-routes Patch
i18n-routes-ssr Patch
@integration-test/image-component Patch
main-entry-name Patch
nonce Patch
pure-esm-project Patch
routes-match Patch
routes Patch
app-rsbuild-hooks Patch
rsc-csr-app Patch
rsc-csr-routes Patch
rsc-ssr-app Patch
rsc-ssr-routes Patch
basic-app-rstest-browser Patch
basic-app-rstest Patch
runtime-custom-plugin Patch
runtime-custom-config-plugin Patch
select-mul-entry-test Patch
select-one-entry-test Patch
server-config Patch
server-json-script Patch
server-monitors Patch
server-prod Patch
server-routes Patch
@source-code-build/app Patch
ssg-fixtures-mega-list-routes Patch
ssg-fixtures-nested-routes Patch
ssg-fixtures-simple Patch
ssg-fixtures-web-server Patch
ssr-base-async-entry-test Patch
ssr-base-json-test Patch
ssr-base-test Patch
ssr-base-fallback-test Patch
init Patch
ssr-base-loadable Patch
ssr-partial-test Patch
rsc-closing-tags-test Patch
ssr-script-loading Patch
ssr-useid-test Patch
ssr-streaming-inline-test Patch
ssr-streaming-test Patch
integration-storybook Patch
styled-components-stream Patch
styled-components-string Patch
integration-tailwindcss-v2 Patch
integration-tailwindcss-v3 Patch
integration-tailwindcss-v4 Patch
tmp-dir Patch
write-to-dist Patch
@modern-js/bundle-diff-benchmark Patch
@modern-js/main-doc Patch
@modern-js/tsconfig Patch
@modern-js/builder Patch
@modern-js/plugin-data-loader Patch
@modern-js/render Patch
@modern-js/bff-core Patch
@modern-js/bff-runtime Patch
@modern-js/server-core Patch
@modern-js/create-request Patch
@modern-js/prod-server Patch
@modern-js/server-runtime Patch
@modern-js/server Patch
@modern-js/server-utils Patch
@modern-js/create Patch
@modern-js/i18n-utils Patch
@modern-js/plugin Patch
@modern-js/runtime-utils Patch
@modern-js/sandpack-react Patch
@modern-js/types Patch
@modern-js/utils Patch
@modern-js/rslib Patch
@scripts/prebundle Patch
@scripts/rstest-config Patch
@scripts/release-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 1, 2026

Deploy Preview for modernjs-byted ready!

Name Link
🔨 Latest commit 15c5457
🔍 Latest deploy log https://app.netlify.com/projects/modernjs-byted/deploys/69cc87370333da0008d15d7f
😎 Deploy Preview https://deploy-preview-8500--modernjs-byted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@GiveMe-A-Name
Copy link
Copy Markdown
Member Author

Updating the PR detail with the root cause and fix rationale here because gh pr edit is currently blocked by a GitHub Projects classic GraphQL error.

Root cause

This regression started after 89fea12862db894d94b29bbfe94df2a97bd67a69, which switched dev TypeScript runtime loading toward the Node 22 native loader path.

The regression only affects the dev server runtime path. modern.server.ts can still be loaded successfully, and its exported config shape is correct, but middleware/context behavior no longer matches the previous ts-node path in the affected scenario. In practice, this caused middleware defined in modern.server.ts to stop behaving consistently for bff-hono in dev, which then broke the Hono BFF context-dependent flow.

Why this fix

Instead of rolling back the whole Node 22 loader change, this change applies a narrow fallback for the dev server runtime path: when ts-node is available, prefer it for this sensitive runtime-loading scenario.

This keeps the existing Node 22 loader behavior for the previously fixed server-config case, while restoring the stable middleware/context behavior required by bff-hono in dev.

Verification

  • cd tests && npm run test:framework --filter server-config
  • cd tests && npm run test:framework --filter bff-hono

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Rsdoctor Bundle Diff Analysis

📊 Quick Summary
Project Total Size Change
bundle-diff 2.9 MB 0

Generated by Rsdoctor GitHub Action

@caohuilin caohuilin merged commit 8357729 into main Apr 1, 2026
10 checks passed
@caohuilin caohuilin deleted the fix/bff-hono-dev-runtime branch April 1, 2026 02:51
@caohuilin caohuilin mentioned this pull request Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants